//
//  downTableViewCell.m
//  INAlienLand
//
//  Created by dllo on 15/7/1.
//  Copyright (c) 2015年 dllo. All rights reserved.
//

#import "downTableViewCell.h"
#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height
@implementation downTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.leftimageView = [[UIImageView alloc] init];
        [self.contentView addSubview:self.leftimageView];
        [_leftimageView release];
        
        self.titleLabel = [[UILabel alloc] init];
//        self.titleLabel.font = [UIFont systemFontOfSize:18];
//        self.titleLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
//        self.titleLabel.numberOfLines = 2;
        [self.titleLabel sizeToFit];
        [self.contentView addSubview:self.titleLabel];
        [_titleLabel release];
        
        self.depart_dates = [[UILabel alloc] init];
        self.depart_dates.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.depart_dates];
        [_depart_dates release];
        
        self.depart_place = [[UILabel alloc] init];
        self.depart_place.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.depart_place];
        [_depart_place release];
        
        self.min_price = [[UILabel alloc] init];
        [self.contentView addSubview:self.min_price];
        [_min_price release];
        
        self.market_price = [[UILabel alloc] init];
        self.market_price.font = [UIFont systemFontOfSize:14];
        [self.contentView addSubview:self.market_price];
        [_market_price release];
        
    }
    return self;
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.leftimageView.frame = CGRectMake(10, 10, WIDTH / 3, HEIGHT - 10);
    self.leftimageView.layer.cornerRadius = 10;
    //隐藏多余部分
    self.leftimageView.layer.masksToBounds = YES;
    
    self.titleLabel.frame = CGRectMake(WIDTH / 3 + 10 + 10, 10, WIDTH / 3 * 2 - 30, HEIGHT / 4 - 10);
    
    self.depart_dates.frame = CGRectMake(WIDTH / 3 + 20, HEIGHT / 4, WIDTH / 3 * 2 - 30, HEIGHT / 8);
    
    self.depart_place.frame = CGRectMake(WIDTH / 3 + 20, HEIGHT * 3 / 8, WIDTH / 3 * 2 - 30, HEIGHT / 8);
    
    self.min_price.frame = CGRectMake(WIDTH / 3 + 20, HEIGHT * 3 / 4, WIDTH / 3 , HEIGHT / 4);
    
    self.market_price.frame = CGRectMake(WIDTH * 2 / 3 + 20, HEIGHT * 3 / 4, WIDTH / 3 - 30, HEIGHT / 4);

}

- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
